home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / misc / setman10g.lha / SetMan10g / setman.doc < prev    next >
Encoding:
Text File  |  1992-11-12  |  5.4 KB  |  141 lines

  1.  
  2.  
  3.                                SetFunction Manager
  4.  
  5.                              SetMan / SetManager V1.0
  6.  
  7.  
  8.   Copyright © 1991,1992 by
  9.  
  10.   Nicola Salmoria
  11.   Via Piemonte 11
  12.   53100 Siena ITALY
  13.  
  14.   Internet: mc6489@mclink.it
  15.  
  16.  
  17. This program is FREEWARE. It is NOT, and will never be, public domain.
  18. Copy it as much as you can (provided no charge is made and the archive is left
  19. intact). It cannot be included in any commercial program without the written
  20. permission of the author.
  21.  
  22.  
  23.  
  24. NOVICE USERS
  25. ------------
  26. The program 'SetMan' should be put in C: and executed as the first command in
  27. the startup-sequence. When I say first, I mean FIRST!!  Run it even before
  28. SetPatch.
  29.  
  30. If you're not expert with the Amiga operating system, all you need to know about
  31. SetMan is that it will, under certain circumstances, avoid GURUs. Read on for
  32. more infos.
  33.  
  34.  
  35.  
  36. EXPERT USERS
  37. ------------
  38. Let's go into details. There's a function in exec.library, whose name is
  39. SetFunction(). You know that Amiga libraries contain a 'jump table', where are
  40. stored the addresses of every function in the library. Library functions are
  41. always executed via the jump table, and NEVER through absolute addressing.
  42. SetFunction() allows the user to modify the jump table, in order to insert a
  43. custom routine in place of the standard one.
  44. For example, one could modify the DisplayBeep() vector to play a sound instead
  45. of flashing the screen.
  46.  
  47. SetFunction() is a very useful feature of the Amiga operating system, but it has
  48. the major drawback that there's no system supervising of concurrent use of the
  49. same vector by different tasks. Under certain circumstances, that can be deadly.
  50. Before removing its custom vector, a program should check that it was not
  51. modified again. However, very few do that, and so if you do not terminate such
  52. program in REVERSE order of when you executed them, you'll probably get a system
  53. crash.
  54.  
  55. Another fault of KickStart 1.x is that the dos.library vectors cannot be
  56. modified by SetFunction(), 'cos they do not follow the conventions estabilished
  57. by Commodore itself.
  58.  
  59. SetMan modifies the SetFunction() vector, and inserts a custom routine which
  60. solves both of the previous problems. It keeps a linked list of all changes to
  61. the jump tables, and allows any program to remove its vector at any time.
  62. Moreover, it allows to modify dos.library vectors in a transparent, upward
  63. compatible, way.
  64.  
  65.  
  66. In this archive there's another free gift, whose name is SetManager. SetManager
  67. displays the list of all modified vectors, with the name of the program which
  68. inserted a custom routine, the address of that routine, and the current status.
  69. Status will usually be 'active'; if you click on the function name, you can
  70. disable it, thus removing the custom function. The third possible state is
  71. 'removed', which only occurs when you don't quit programs in the correct order
  72. I explained later. It's there for your information, but is absolutely no
  73. problem. When you exit the other program which uses the same vector, both will
  74. disappear from the list.
  75.  
  76. NOTE: modified vectors are shown as 'offset' 'library name'. However, SetManager
  77. is able to read the standard 'xxx_lib.fd' files, provided by Commodore on the
  78. 'Extras' disk. just assign the name 'FD:' to a directory containing the .fd
  79. files, and they will be read and interpreted when you load SetManager. That way,
  80. you will get the true function names, instead of offsets.
  81.  
  82.  
  83.  
  84. PROGRAMMERS
  85. -----------
  86. You are strongly suggested to use SetMan facilities to modify the dos.library
  87. vectors.
  88. To know if SetMan is running, all you have to do is search for a public MsgPort
  89. named "SetMan". You need that only under KickStart 1.x, 'cos since version 2.0
  90. of the operating system dos.library has joined the rest of us. However, SetMan
  91. is smart enough to use the custom routine for dos.library only if it's really
  92. the non-standard one.
  93. Here is an example of how to proceed:
  94.  
  95. -----------------------
  96.  
  97. if (DOSBase->dl_lib.lib_Version < 36 && !FindPort("SetMan"))
  98. {
  99.       printf("You need SetMan to execute this program!\n");
  100.       exit(RETURN_WARN);
  101. }
  102. else
  103. {
  104.       TrueFunction = SetFunction((struct Library *)DOSBase,FUNCOFFSET,NewFunction);
  105.  
  106.       etc etc.....
  107. }
  108.  
  109. -----------------------
  110.  
  111.  
  112.  
  113. BUGS AND INCOMPATIBILITIES
  114. --------------------------
  115. There are no known bugs in this version of SetMan.
  116.  
  117. A few more words should be spent on compatibility problems.
  118. Due to the very different procedures followed by the original SetFunction() and
  119. by SetMan, it's not possible to guarantee a 100% compatibility with every
  120. program around. Every effort has been made to avoid every possible problem;
  121. SetMan handles correctly every strange behaviour I could think about; the only
  122. way to confuse SetMan should be using two differnt programs communicating
  123. through a message port and doing very strange things. I'm almost sure such
  124. things things should never happen.
  125.  
  126. I've encountered a problem with a program called 'TurboTopaz', which refuses to
  127. quit saying that 'Vector has been changed'. That's true, 'cos SetMan puts a
  128. function of its own ahead of the custom one; if TurboTopaz used SetFunction(),
  129. it would receive in return the value it expects, but it reads directly the jump
  130. table, something I believe is not supported by Commodore.
  131.  
  132. I use a lot of programs which call SetFunction(), and none of them has problems
  133. with SetMan.
  134.  
  135.  
  136.  
  137. ACKNOWLODGEMENT
  138. ---------------
  139. I'd like to thank Marco Ciuchini who pointed out an important incompatibility
  140. problem which I have been able to completely remove.
  141.